import { Body, Controller, Post } from '@nestjs/common';
import { AuthAdmin_Service } from './authAdmin.service';
import { AuthAdmin_SignIn_Dto } from './assets/authAdmin.dto';
import { ApiExtraModels, ApiTags } from '@nestjs/swagger';
import { util_ApiResponse_Base } from '@/common/util/apiResponse';
import { AuthAdmin_SignIn_ReClass } from './assets/authAdmin.class';
import { util_Index_ReturnContent } from '@/common/util/index';

@Controller('/adm/authAdmin')
@ApiTags('authAdmin 登录')
export class AuthAdmin_Controller {
  constructor(private authAdmin_Service: AuthAdmin_Service) {}

  @Post('/signIn')
  @ApiExtraModels(AuthAdmin_SignIn_ReClass)
  @util_ApiResponse_Base({
    dataType: 'dataType_object',
    status: 201,
    description: '登录成功',
    type: AuthAdmin_SignIn_ReClass,
    //apiKey: '/adm/authAdmin/signIn Post',
    summary: '登录',
    noAuth: true,
  })
  async authAdmin_SignIn(@Body() body: AuthAdmin_SignIn_Dto) {
    return util_Index_ReturnContent(await this.authAdmin_Service.authAdmin_SignIn(body));
  }
}
